#pragma once

template<class T>
struct Widget;

template<class T>
struct ListNode_T
{
	ListNode_T(Widget<T>* OwnNode)
		:_OwnNode(OwnNode)
	{}

	Widget<T>* _OwnNode;
};

template<class T>
struct MapNode_T
{
	MapNode_T(Widget<T>* OwnNode)
		:_OwnNode(OwnNode)
	{}

	Widget<T>* _OwnNode;
};

template<class T>
struct Widget
{
	Widget(const T& val = T())
		:_ln(nullptr), _mn(nullptr), _val(val)
	{
		_ln = new ListNode_T<T>(this);
		_mn = new MapNode_T<T>(this);
	}

	ListNode_T<T>* _ln;
	MapNode_T<T>* _mn;
	T _val;
};